package com.toe.sso.controller;

import com.toe.common.restful.JsonResult;
import com.toe.sso.pojo.vo.UserInfoVO;
import com.toe.sso.service.IUserInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Api(tags = "用户信息模块")
@RequestMapping(value = "/user/info/sso", produces = "application/json; charset=utf-8")
public class UserInfoController {

    @Autowired
    private IUserInfoService userInfoService;
    @ApiOperation(value="获取登录用户信息")
    @GetMapping("/")
    public JsonResult<UserDetails> userInfo(){
        UserDetails userInfo=userInfoService.userInfo();
        return JsonResult.ok(userInfo);
    }
}
